package com.xps.charminguser.view.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.xps.charminguser.R;
import com.xps.charminguser.utils.CommonUtils;
import com.xps.charminguser.view.base.BaseActivity;
import com.xps.charminguser.view.fragment.ConductFragment;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class conductActivity extends AppCompatActivity {
    ConductFragment confragment;
    @BindView(R.id.actionbar_iv_back)
    ImageView actionbarIvBack;
    @BindView(R.id.actionbar_iv_title)
    ImageView actionbarIvTitle;
    @BindView(R.id.actionbar_tv_title)
    TextView actionbarTvTitle;
    @BindView(R.id.home_titlecenter)
    AutoLinearLayout homeTitlecenter;
    @BindView(R.id.actionbar_tv_right)
    TextView actionbarTvRight;
    @BindView(R.id.rll_title_bg)
    AutoRelativeLayout rllTitleBg;
    @BindView(R.id.fr_myorder)
    FrameLayout fragmentConduct;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_conduct);
        ButterKnife.bind(this);
        actionbarTvTitle.setText("订单列表");
        actionbarTvTitle.setTextColor(getResources().getColor(R.color.white));
        confragment = new ConductFragment();
        this.getSupportFragmentManager().beginTransaction().add(R.id.fr_myorder, confragment).disallowAddToBackStack().commit();
        showFragment(confragment);
    }

    public void showFragment(Fragment showFragemt) {
        hideFrags();
        this.getSupportFragmentManager().beginTransaction().disallowAddToBackStack().show(showFragemt).commit();
    }

    public void hideFrags() {
        confragment.hide();
    }

    @OnClick(R.id.actionbar_iv_back)
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.actionbar_iv_back:
                finish();
                break;
        }
    }
}
